#! /usr/bin/env python
'''
    

'''
from threading import Thread
from time import sleep


#自定义类
class WriCase(Thread):

 def __init__(self,queue):
    Thread.__init__(self)
    self.queue = queue
    self.cmd = None
    self.exit = False

 def execute(self):
      print("man start!")
      while not self.exit:
         #时刻检查更新
         self.update()
         sleep(0.3)
      self.end()

 def run(self):
    self.execute()

 def update(self):
     while(not self.queue.empty()):
         self.cmd = self.queue.get()
         if(self.cmd == "quit"):
            self.exit = True
         print(self.cmd)
         print("执行更新命令")

 def end(self):
   #  super().terminate()
    print("Process ending")